<?php

require '../data/data.php';

$gid = $_GET['gid'];
$op = $_GET['op'];
if ($op == 1) $sql = 'update `cart` set num = num - 1 where gid = ?';
if ($op == 2) $sql = 'update `cart` set num = num + 1 where gid = ?';

execute($sql, [$gid]);
header('Location:../cart.php');